<?php
$this->beginBlock('toolbar');
$t = $this->toolbar();
echo $t->renderBegin();
echo $t->renderItem($this->link($this->__('system.button.back'), $this->historyUrl('*/*/*/index')));
echo $t->renderEnd();

$this->nextBlock('form');
$f = $this->form()->setId('form');
if($this->model):
	$f->setData($this->model->getAllData());
endif;

echo $f->renderBegin();
echo $f->createField($this->__('system.label.code'), TRUE)
       ->setInput($this->textbox('code', 'model[code]')->addCharacterRule());

echo $f->createField($this->__('system.label.name'), TRUE)
       ->setInput($this->textbox('name', 'model[name]')->addCharacterRule());

echo $f->createField($this->__('system.label.version'), TRUE)
       ->setInput($this->textbox('version', 'model[version]')->addCharacterRule());

echo $f->createField($this->__('system.label.author'), TRUE)
       ->setInput($this->textbox('author', 'model[author]')->addCharacterRule());

echo $f->createField($this->__('system.label.website'))
       ->setInput($this->textbox('website', 'model[website]')->addCharacterRule());

echo $f->createField($this->__('system.label.email'))
       ->setInput($this->email('email', 'model[email]'));

echo $f->createField($this->__('system.label.description'))
       ->setInput($this->textbox('description', 'model[description]'));

echo $f->createField($this->__('system.label.create_directory'), TRUE)
       ->setInput($this->selectBoolean('is_create_directory', 'model[is_create_directory]')->setValue(TRUE));

echo $f->createField($this->__('system.label.backend_domain'), TRUE)
       ->setInput($this->selectBoolean('is_backend', 'model[is_backend]')->setValue(TRUE));

echo $f->createField($this->__('system.label.frontend_domain'), TRUE)
       ->setInput($this->selectBoolean('is_frontend', 'model[is_frontend]')->setValue(TRUE));

echo $f->createField($this->__('system.label.member_domain'), TRUE)
       ->setInput($this->selectBoolean('is_member', 'model[is_member]')->setValue(TRUE));
echo $f->renderEnd();

$t2 = $this->toolbar();
echo $t2->renderBegin();
echo $t2->renderItem($this->linkButton($this->__('system.button.submit'), "submitForm('form')"));
echo $t2->renderEnd();
$this->endBlock();
echo $this->extend('template'.DS.'form');